package com.zz.Enum;

public class Test {
    public static void main(String args[]){
        A a = A.Y;//每个枚举常量都记住枚举类对象
        System.out.println(a);

//        A b = new A();构造器私有，无法对外创建对象。

        //枚举类提供一个一些额外的API
        A[] as = A.values();//获得所有枚举对象
        A a1 = A.valueOf("Z");//获得该对象
        System.out.println(a1.name());
        System.out.println(a1.ordinal());//索引

        B b = B.Y;
        b.go();
    }
}
